package com.hongxin.nw.netty.model.packing;

import com.hongxin.nw.netty.utils.FieldPack;
import com.hongxin.nw.netty.values.TypeIdentif;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * @remark --
 * @author: GuoXiaolin
 * @date 2019/5/20 16:14
 * @Version 1.0
 * @Descibe
 */
@Slf4j
@Getter
@Setter
public class ASDUcsdna1{

    private String logType;//在表13-2中定义	下发记录类型
    private String sendData;//在A.31中定义  	下发数据项

    public void setLogType(String logType) {
        this.logType = FieldPack.caseToBin(logType, TypeIdentif.BYTE_LOG_TYPE.getByteLength());
    }
    public void setSendData(String sendData) {
        this.sendData = sendData;
    }

    public String getHexData() {
        return this.logType + this.sendData;
    }

    @Override
    public String toString() {
        return "ASDUcsdna1{" +
                "logType='" + logType + '\'' +
                ", sendData='" + sendData + '\'' +
                '}';
    }
}
